var createUploader =function() {
	return {
		uploader : function() {
			var uploader = new qq.FineUploader(
					{
						element : document.getElementById('result-uploader'),
						request : {
							endpoint : 'uploadfile'
						},
						text : {
							uploadButton : '<i class="glyphicon glyphicon-plus"></i>上传文件'
						},
						template : '<div class="qq-uploader">'
								+ '<pre class="qq-upload-drop-area"><span>{dragZoneText}</span></pre>'
								+ '<div class="qq-upload-button btn btn-default btn-sm" style="background: #F6F6F6;border: 1px solid rgb(206, 206, 206);display: inline;top: 3px;padding: 5px 15px 7px 15px;width: 100%;position: relative;overflow: hidden;border-radius: 0;">{uploadButtonText}</div>'
								+ '<span class="qq-drop-processing" style="display:none"><span>{dropProcessingText}</span>'
								+ '<span class="qq-drop-processing-spinner"></span></span>'
								+ '<ul class="qq-upload-list" style="margin-top: 10px; text-align: center;display:none"></ul>'
								+ '</div>',
						classes : {
							success : 'alert alert-success',
							fail : 'alert alert-error'
						},
						callbacks : {
							onComplete : function(id, fileName, responseJSON) {
								if (responseJSON.type=='success') {
									var filepath = responseJSON.data;
									//createUploader.deletefile(filepath);
									createUploader.inputhours(filepath);
								}
							}
						}
					});
		},
		deletefile : function(filepath) {
			var data={
				path : 	filepath,
			}
			$.ajax({
				"dataType" : 'json',
				"cache": false,
				"type" : "POST",
				"data" : data,
				"url" : ctx + "/oahour/deletfile",
				"success" : function(data) {
					if(data.type=='success'){
						
					}else{
						alert(data.message);
					}
				}
			});
		},
		inputhours : function(filepath){
			var data={
					path  : 	filepath,
				}
				$.ajax({
					"dataType" : 'json',
					"cache": false,
					"type" : "POST",
					"data" : data,
					"url" : ctx + "/oahour/inputhours",
					"success" : function(data) {
						if(data.type=='success'){
							
						}else{
							
						}
					}
				});
		},
	}
}();